//
//  lxAPPContainer.h
//  luodansc
//
//  Created by 倫 星 on 2012/10/21.
//  Copyright (c) 2012年 方正株式会社. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Reachability.h"

typedef NS_ENUM(unsigned char, LUN_NET_SIGNAL) {
    HostConnOK = 0x01,
    HostConnNG = 0x02,
    InternetConnOK = 0x04,
    InternetConnNG = 0x08,
    WifiConnOK = 0x10,
    WifiConnNG = 0x20,
    NOTHING = 0x00
};

@protocol netDelegate

@optional
-(void)netHostReachChangedOK;
-(void)netInternetReachChangedOK;
-(void)netWifiReachChangedOK;

-(void)netHostReachChangedNG;
-(void)netInternetReachChangedNG;
-(void)netWifiReachChangedNG;
@end

@class lxGoodsEntity;

@interface lxAPPContainer : NSObject<UIAlertViewDelegate> {
    NSUserDefaults *_userDefaults;
    
    lxUserInfoEntity *_userInfoEntity;
    lxAppInfoEntity* _appInfoEntity;
    NSMutableArray *_arrayShoppingList;
    
    LUN_NET_SIGNAL _net_signal;
    
    Reachability* _hostReach;		// ホスト接続
    Reachability* _internetReach;	// 3Gネットワーク
    Reachability* _wifiReach;		// Wi-Fi
    
    id<netDelegate> _delegate;
}

@property (nonatomic, retain) NSUserDefaults *userDefaults;
@property (assign) LUN_NET_SIGNAL net_signal;

+ (lxAPPContainer *)sharedLxAPPContainer;

- (void)setUserInfoEntity:(lxUserInfoEntity *)userInfoEntity;
- (lxUserInfoEntity*)getUserInfoEntity;
- (void)delUserInfoEntity;

- (void)setAppInfoEntity:(lxAppInfoEntity *)appInfoEntity;
- (lxAppInfoEntity *)getAppInfoEntity;

- (void)addShopping:(lxGoodsEntity*)goodsEntity;
- (NSMutableArray*)getArrayShoppingList;

- (BOOL)isExistNet;
- (BOOL)isIPhone;

@end
